<template>
  <div>
    <div id="wapper">
      <my-header :headerParam="headerParam"></my-header>
      <!---->
      <!---->
      <div id="set">
        <router-link to="{path:'/notice',query:{operator:}}" class="notice_line">
          <i class="noticeIcon"></i>
          <div class="line-con ">
              <div class="title">通知 : 加盟政策变更</div>
              <div class="time">2018-08-08  10:54</div>
          </div>
          <span class="icon"></span>
        </router-link>
        <router-link v-for="(item,index) in NotiveArr" :key="index" :to="{path:'/notice',query:{
          content:item.content}}" class="notice_line">
           <i class="noticeIcon"></i>
          <div class="line-con ">
            <span class="t1">
              <div class="title">公告 : {{item.title}}</div>
              <div class="time">{{item.gmtCreate}}</div>
             </span>
           </div>
          <span class="icon"></span>
        </router-link>
         
          
        
        
      </div>
    </div>
  </div>
</template>
<script>
  import MyHeader from '@/components/header'
  import {MessageBox} from 'mint-ui';
  import { fetchGetData, fetchPostData, host } from "@/api";
  export default{
    data(){
      return {
        headerParam: {
          title: '公告',
          setting: 0,
          back: 1
        },
        NotiveArr:[]
      }
    },
    components: {MyHeader, MessageBox},
    methods: {
       getNotices() {
      let source = 1; //1,销售端 2,商家端
      let _that = this;
      fetch(host + "/agent/ntc/getNtcText?source=1", {
        method: "GET",
        headers: {
          "x-token": this.$store.state.token
        }
      })
        .then(res => res.text())
        .then(res => {
          var res = JSON.parse(res);

          if (res.status == 1) {
            _that.NotiveArr = res.data.text.data.rows;
            console.log(_that.NotiveArr);
          }
        });
    }
    },
    mounted: function () {
        this.getNotices();
    }
  }
</script>
<style lang="less" scoped>
 .quitlogin{
  background-color:#fff;
 }
 .notice_line {
   display:block;
   height: 1.55rem;
   line-height:1.55rem;
   padding-left: .29rem;
    border-bottom: 1px solid #eee;
    i{
 
      display: inline-block;
      vertical-align: middle;
      width:.9rem;
      height:.9rem;
      background: url(../../assets/images/myc/noticeIcon.png) no-repeat center;
      background-size: 100%;
      margin-top: -10px;
    }
    .line-con{
 
        width: 69%;
        display: inline-block;
        vertical-align: middle;
        padding-left: 20px;
        height:60%;
       .title{
         font-size:.3rem;
         line-height:.45rem;
         color: #333333;
          height: 50%;
          

       }
       .time{
         font-size:.24rem;
         
         line-height: .45rem;
         color: #999999;
         height: 49%;
        }
    }
   .icon{
    display: inline-block;
  
    width:5%;
    height: 60%;
    vertical-align: middle;
   background: url(../../assets/images/set_bg1.png) no-repeat center;
  background-size: 0.14rem 0.26rem;
   }
    
 }
#header{
   border-bottom: 1px solid #eeeeee; 
}
</style>

